/*
 * @Author: 刘美红 liumeihong@llootong.com
 * @Date: 2025-04-16 11:44:53
 * @LastEditors: 刘美红 liumeihong@llootong.com
 * @LastEditTime: 2025-04-17 11:45:39
 * @FilePath: \gzt-template\src\main.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { createApp } from 'vue';
import { createPinia } from 'pinia';
import '@/assets/reset.scss';
import '@/assets/main.css';
import '@/assets/page-common.scss';
import '@/assets/font/iconfont.css';
import App from './App.vue';
import router from './router/index';
import './router/permission';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
import Casdoor from 'casdoor-vue-sdk';

import '@/api/mock/mock.js';

// 如果您正在使用CDN引入，请删除下面一行。
import * as ElementPlusIconsVue from '@element-plus/icons-vue';

const config = {
  // serverUrl: process.env.NODE_ENV === "production" ? "http://20.13.0.125:8085" : "http://192.168.99.195:8001",
  // clientId: process.env.NODE_ENV === "production" ? "24f6f118ec6dbeaf0239" : "014c61932ae04112a313",
  serverUrl: import.meta.env.VITE_CASE_DOOR,
  clientId: import.meta.env.VITE_CLINTID,
  appName: 'server_usermanage',
  redirectPath: '/#/login',
};
const pinia = createPinia();

pinia.use(piniaPluginPersistedstate);
const app = createApp(App);
app.use(pinia);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app.use(ElementPlus, {
  locale: zhCn,
});
app.use(Casdoor, config);
console.log(router, '--------');

app.use(router);
app.mount('#app');
